<me:UIAB05RZ  x:Class="WPFExcelReport.TAB05RZ"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
     xmlns:me="clr-namespace:WPFExcelReport"
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:G8="clr-namespace:WPFExcelReport;assembly=TGASTGA" 
     xmlns:AP="clr-namespace:WPFExcelReport;assembly=TAPKOPF" 
     xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
     xmlns:WD="clr-namespace:WPFExcelReport;assembly=TWDECK" 
     xmlns:WA="clr-namespace:WPFExcelReport;assembly=TWAFARBEN" 
     xmlns:AR="clr-namespace:WPFExcelReport;assembly=TABPR"
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
     Loaded="Window_Loaded"
     x:Name="TV" 
 >
    <me:UIAB05RZ.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
    </me:UIAB05RZ.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0" IsEnabled="{Binding ERLKZ,ElementName=TV,Converter={StaticResource not}}">
            <Button Grid.Column="1" Height="20"  Width="24" Margin="0,0,0,0"  Click="EditCommand" IsEnabled="{Binding IsCanChg,ElementName=TV}"
                    Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                    >
                <Button.Background>
                    <ImageBrush ImageSource="/ImagePackage;component/Images/Edit.png" />

                </Button.Background>
            </Button>
            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="20"   Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                </Button.Background>
            </Button>
            <Button Grid.Column="1" Height="20"  Width="24" Margin="0,0,0,0"  Click="btnPrePlan_Click">
                <Button.Background>
                    <ImageBrush ImageSource="/ImagePackage;component/Images/Refresh.png" />

                </Button.Background>
            </Button>
        </WrapPanel>
        <PR:TRZRULES Grid.Row="0" Grid.Column="1" 
                      IsEdit="{Binding IsEdit,ElementName=TV}" 
                     KRS="{Binding KRS,ElementName=TV}" 
                     Name="cRule"  ARTSTAGE="F"    
                     FLOW ="{Binding FLOW,ElementName=TV}"   
                     WH="{Binding WH,ElementName=TV}" 
                     dwRule="{Binding dwRule,ElementName=TV}" 
                     RLPRART="{Binding PRART,ElementName=TV}"  
                     QTY="{Binding QTY,ElementName=TV}"  
                     EXAUF="{Binding EXAUF,ElementName=TV}"
                     ORDERNUM="{Binding RULEKEY,ElementName=TV}"
                     />
        <Grid  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
                <RowDefinition   Height="Auto" />
            </Grid.RowDefinitions>
            <MU:TABMU   Grid.Row="0"   
                       EXAUF="{Binding AUF,ElementName=TV}"
                     /> 
            <WD:TWDECK  Grid.Row="2" 
                    Visibility="{Binding IsAuto,ElementName=TV,Converter={StaticResource bv}}"  
                    ORDERNUM="{Binding KEY,ElementName=TV}"
                />
        </Grid> 
    </Grid>
</me:UIAB05RZ>
